//
//  HelpMeBagViewController.m
//  MRBang
//
//  Created by 铅笔 on 15/12/14.
//  Copyright © 2015年 杭州易网新科技. All rights reserved.
//

#import "HelpMeBagViewController.h"

@interface HelpMeBagViewController ()

@property (nonatomic,strong) UITextField *textField_telphone;

@property (nonatomic,strong) UIButton *button_getTelphoneCheckCode;

@end

@implementation HelpMeBagViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"填写手机号";
    
    //创建子视图
    [self initWithAllSubviews];

    //    手势问题
    UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(leftSwipe)];
    swipe.direction = UISwipeGestureRecognizerDirectionRight;
    [self.view addGestureRecognizer:swipe];
    
    UISwipeGestureRecognizer *toleftswipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(rightSwipe)];
    toleftswipe.direction = UISwipeGestureRecognizerDirectionLeft;
    [self.view addGestureRecognizer:toleftswipe];
}

- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = NO;
    self.tabBarController.tabBar.hidden = YES;
}

#pragma mark ---- 创建子视图
- (void) initWithAllSubviews
{
    UILabel *label_title = [[UILabel alloc] initWithFrame:CGRectMake(20, 64+41*PROPORTION_WIDTH, kScreenWidth-40, 20)];
    [self.view addSubview:label_title];
    label_title.text = @"请保持手机的畅通,用于接收验证码短信";
    label_title.font = [UIFont systemFontOfSize:Font_SIZE_22];
    label_title.textColor = COLOT_TEXTGRAY;
    
    self.textField_telphone = [[UITextField alloc] initWithFrame:CGRectMake(20,104*PROPORTION_WIDTH+64,kScreenWidth - 40, 70*PROPORTION_WIDTH)];
    [self.view addSubview:self.textField_telphone];
    
    //手机号
    self.textField_telphone.placeholder = @" 请填写注册时使用的手机号码";
    self.textField_telphone.layer.cornerRadius = 3.0;
    self.textField_telphone.keyboardType = UIKeyboardTypeNumberPad;
    self.textField_telphone.clipsToBounds = YES;
    self.textField_telphone.layer.borderColor = RXDColor(201, 201,201).CGColor;
    self.textField_telphone.layer.borderWidth = 1.0;
    self.textField_telphone.font = [UIFont systemFontOfSize:Font_SIZE_22];
//    [self.textField_telphone addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
    
    //设置修改button
    self.button_getTelphoneCheckCode = [[UIButton alloc] initWithFrame:CGRectMake(20, self.textField_telphone.bottom+60*PROPORTION_WIDTH,kScreenWidth - 40, 95*PROPORTION_WIDTH)];
    [self.view addSubview:self.button_getTelphoneCheckCode];
    self.button_getTelphoneCheckCode.backgroundColor = RXDColor(255, 118, 112);
    [self.button_getTelphoneCheckCode setTitle:@"获取手机验证码" forState:UIControlStateNormal];
    self.button_getTelphoneCheckCode.layer.cornerRadius = 3.0;
    self.button_getTelphoneCheckCode.clipsToBounds = YES;
    [self.button_getTelphoneCheckCode.titleLabel setFont:[UIFont systemFontOfSize:Font_SIZE_18*2]];
    
//    [self.button_getTelphoneCheckCode addTarget:self action:@selector(getTelphoneCheckCodeButton) forControlEvents:UIControlEventTouchUpInside];


}

- (void)leftSwipe {
    if (self.tabBarController.selectedIndex == 0) {
        //这边根据需求写
        return;
    }
    self.tabBarController.selectedIndex--;
}

- (void)rightSwipe {
    if (self.tabBarController.selectedIndex == self.tabBarController.childViewControllers.count-1) {
        //这边根据需求写
        return;
    }
    self.tabBarController.selectedIndex++;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end
